Assignment
Propose a final project that integrates the range of units covered:
1. WHAT WILL I DO?
I will make a large wall piece that is a game with lights that also serves as a sound swallower. The object of the game is to find a matching light pair by removing a piece from the hole to see which color light is in the hole and then to find the same light by removing a piece from another hole. ((Memory Game) When you put all the cards facing down and turn one card at a time in order to find matching pairs. The winner is the one with more pairs) There will be eighteen holes(nine different lights) with a Led light in it. A magnetic sensor will turn on the light when a piece is removed from the hole and turn of the light when the piece is put back in. When the game is over - all nine pairs have been found. There will be a reset button of some sort that will put at random the light for every hole.
2. Who's done what beforehand?
There are a lot of games out there that are similar to what I want to do so finding a code to build on will not be difficult. I have been researching sound insulation art for inspiration.
3. What materials and components will be required?
I need to make 18 boards with the Led and a hall sensor for the finished version of my final project. I will have the Led and the hall sensor on the same board. In the prototype I will have four Led boards and four hall sensor boards.
I need to figure out what will be the main material in the wall piece itself. I´m thinking of testing cork and different type of foam. I want to make the pieces with the magnet out of the same material.
4. Where will they come from?
I have placed an order for the electrical material that I can not buy from the Lab (hall sensors and microcontrollers). Most of the electrical components I will buy from the Lab. The cork or the foam I will buy here in Iceland.
5. How much will it cost?
It will be under $ 300.
6. What parts and systems will be made?
I´m controlling the game from a website - javascript(dreamweaver) with node Bridge, websocket and Arduino. I need to make the wall piece with the holes and the little pieces with the magnets that go in the holes.
7. What processes will be used?
I will set up and control the game from a website that I create in Dreamweaver and use Javascript - there I have a code for websocket. I set up node.js a bridge from the website to the board(microcontroller. I program the boards with Arduino.
8 What tasks need to be completed?
I have an Arduino code with the function for the 9 different lights that I want. I found a website with the memory game that I copied and changed so it´s working with my light board through the bridge and a Arduino code. I have two Led boards and two hall sensors boards so I need to make two of each for my prototype (redesign my hall sensor board.) I still need to figure out in my programming how to program it so the lights work with the magnets. There is also something in the programming in how I connect all the lights that I need to figure out.
I need to do some tests on different materials for the actual piece and then make the piece and all the little pieces. I think I want to use the height map method from composites week for the design of the big piece but I need to design the 18 small pieces. I know I want to use the shopbot for the big piece but I haven´t decided on the small pieces.
9. What questions need to be answered?
I still need to figure out in my programming how to program it so the lights work with the magnets. There is also something in the programming in how I connect all the lights that I need to figure out. What is the best material for my project?
10. What is the schedule?
I´m hoping to have all my programming and the electronics for the prototype finished before May 25th and then I have little over two weeks to do some tests on different materials and to build my piece.
11. How will it be evaluated?
I´m hoping to have a working prototype with four lights - two pairs. I would also like to have the wall piece with all the little pieces finished.
This week I started working in Arduino and I figured out functions that will change the Led for nine different colors. Here is the code:
Then I found this website with the memory game using javascript. I set up my site in Dreamweaver, linked my html. scc, javascript and websocket code together and then I copied the code from this site and made some changes.
Here is the html code:
Here is the code for the websocket:
I made a folder called "Lokaverkefni (final project)" were I put the node bridge in. I was lucky that Sigga(Sigridur Helga Hauksdottir) that is in my group had downloaded the node before me and she ran into some problems getting it to work but she shared with me so everything worked fine - see here. Here is the code for the bridge:
Here is the Javascript and the changes that I made:
Here is the Arduino code that I used:
Here it is how it developed:
Here is how I made some changes
How it works now: I have the first spot named '1' and it´s connected to the board. When I hit start the light goes off but only when I click on the first card does the light turn on. I get a green light for G, blue for B and red for R. I used my Arduino code from last week and changed it to work with the game. I only changed the main loop so:
void loop() // run over and over
{
if (mySerial.available() >=2 ) { // If data is available to read,
int targetID = mySerial.read();
if (targetID ==ID){
val = mySerial.read(); // read it and store it in val
}
}
My next step is to add the magnet feature into the code and figure out how all the boards will connect.
All the files for the final project are in Project Development - week 19.